<template>
    <div class="detailshop">
        <div class="shopTitle">
            <span class="shopLogo">
                <img :src="shop.shopLogo" alt="">
            </span>
            <span class="shopName">
                {{shop.name}}
            </span>
        </div>
        <div class="goodsinfo">
            <div class="goodscount">
                <div>
                    <div>{{(shop.cSells/10000).toFixed(1)}}万</div>
                    <span>总销量</span>
                </div>
                <div>
                    <div>{{shop.cGoods}}</div>
                    <span>全部宝贝</span>
                </div>
            </div>
            <div class="goodscomment">
                <div v-for="(item,index) in shop.score" :key="index">
                    <span>{{item.name}}</span>
                    <span class="score" :class="{'iscore':item.isBetter}">{{(item.score).toFixed(2)}}</span>
                    <span class="better" :class="{'ibetter':item.isBetter}">{{item.isBetter?"高":"低"}}</span>
                </div>
            </div>
        </div>
        <div class="button">
            <button>进店逛逛</button>
        </div>
    </div>
</template>
<script>
export default {
    name:"DetailShop",
    props:{
        shop:{
            type:Object,
            default:{}
        }
    }
}
</script>
<style lang="css" scoped>
    .detailshop{
        padding-bottom:10px;
        border-bottom:3px solid rgb(226, 226, 226);
    }
    .shopTitle{
        margin: 10px 15px;
    }
    .shopLogo{
        display: inline-block;
        height: 40px;
        width: 40px;
        border-radius: 50%;
        overflow: hidden;
        vertical-align: middle;
    }
    .shopLogo img{
        width: 40px;
        vertical-align: middle;
    }
    .shopName{
        margin-left: 10px;
        font-size:14px;
    }
    .goodsinfo{
        padding-bottom: 10px;
        display: flex;
        align-items: center;
        justify-content: center;
        
    }
    .goodsinfo>div{
        flex:1;
        display: inline-block;
    }
    .goodscount{
        border-right: 2px solid rgb(226, 226, 226);
        text-align: center;
    }
    .goodscount>div{
        display: inline-block;
        text-align: center;
        margin-right:10px;
    }
    .goodscount>div>div{
        margin-bottom: 2px;
        font-size: 14px;
    }
    .goodscount>div>span{
        font-size: 13px;
    }
    .goodscomment{
        text-align: center;
        font-size: 13px;
    }
    .goodscomment>div{
        margin-bottom: 5px;
    }
    .goodscomment>div>span{
        margin-right: 8px;
    }
    .score{
        color: green;
    }
    .better{
        color:white;
        background: green;
    }
    .iscore{
        color: red;
    }
    .ibetter{
        color:white;
        background: red;
    }
    .button{
        display: flex;
        justify-content: center;
        align-items:center;
    }
    .button button{
        width: 200px;
        background: rgb(238, 238, 238);
        font-size:15px;
        border:none;
        height: 25px;
        line-height: 25px;
        border-radius:5px;
        outline: none;
    }
</style>